Skip to content

Conversation

@breskeby
Copy link
Contributor

@breskeby breskeby commented Mar 5, 2025

  • for running :plugins:discovery-ec2:check
  • checking if in idea in build scan background action

- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
@breskeby breskeby added >non-issue :Delivery/Build Build or test infrastructure labels Mar 5, 2025
@breskeby breskeby requested a review from a team as a code owner March 5, 2025 08:58
@breskeby breskeby added Team:Delivery Meta label for Delivery team auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 v8.16.6 v8.17.4 labels Mar 5, 2025
@breskeby breskeby self-assigned this Mar 5, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

}
} else {
tag 'LOCAL'
if (providers.systemProperty('idea.active').present) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when running with configuration cache enabled, Project#providers is not available from a build scan background action. we can fall back to normal System.getProperty check instead as gradle instruments System.getProperty calls automatically to take into account for configuration caching.

final File javaPolicy = new File(layout.buildDirectory.asFile.get(), "tmp/java.policy")
outputs.file(javaPolicy)
doLast {
final File tmp = file("${buildDir}/tmp")
Copy link
Contributor Author

@breskeby breskeby Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Project#file utility method and the buildParams extension are not available from task execution phase (e.g. running in doLast) when configuration cache enabled.

We moved declaring the output file and the inFips boolean into the configuration phase and also declared them as proper inputs/outputs for the writeTestJavaPolicy task to mark it properly as up-to-date on unchanged reruns.

Some background on this: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements

// this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property
// it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'`
if (buildParams.inFipsJvm){
nonInputProperties.systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project#buildDir is a deprecated and will be removed at one point

@breskeby breskeby requested a review from jozala March 5, 2025 09:06
@breskeby breskeby added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 5, 2025
Copy link
Contributor

@jozala jozala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed explanation. It is helpful.
LGTM

@elasticsearchmachine elasticsearchmachine merged commit cfa98f3 into elastic:main Mar 5, 2025
17 checks passed
@breskeby breskeby deleted the discovery-ec2-cc-fix branch March 5, 2025 10:07
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0
8.16
8.17

elasticsearchmachine pushed a commit that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
elasticsearchmachine pushed a commit that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
elasticsearchmachine pushed a commit that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
elasticsearchmachine pushed a commit that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
breskeby added a commit that referenced this pull request Mar 5, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Mar 11, 2025
- for running :plugins:discovery-ec2:check
- checking if in idea in build scan background action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v8.16.6 v8.17.4 v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants